<?php
class Default_Form_Regis extends Zend_Form{
    
    public function init(){       
        $this->setAction('/default/auth/regis');        
        $fullname=new Zend_Form_Element_Text('fullName');
        $fullname->setAttrib('placeholder','Fullname');                
        $fullname->setRequired(true)->addValidator('NotEmpty')->addFilter('StripTags')->addFilter('StringTrim')        
            ->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $email=new Zend_Form_Element_Text('email');
        $email->setAttrib('placeholder','Email');        
        $email->setRequired(true)->addValidator('NotEmpty')->addValidator('EmailAddress')->addFilter('StripTags')->addFilter('StringTrim')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');                
                    
        $pass=new Zend_Form_Element_Password('password');
        $pass->setAttrib('placeholder','Password');                
        $pass->setRequired(true)->addValidator('NotEmpty')                                  
            ->removeDecorator('HtmlTag')->removeDecorator('Label');        
            
        $captcha = new Zend_Form_Element_Captcha(  
            'captcha', // This is the name of the input field  
            array(
            'captcha' => array( // Here comes the magic...  
            // First the type...  
            'captcha' => 'Image',  
            // Length of the word...  
            'wordLen' => 6,  
            // Captcha timeout, 5 mins  
            'timeout' => 300,  
            // What font to use...  
            'font' => PUBLIC_PATH.'/captcha/arial.ttf',  
            // Where to put the image  
            'imgDir' => PUBLIC_PATH.'/captcha/',  
            // URL to the images  
            // This was bogus, here's how it should be... Sorry again :S  
            'imgUrl' => '/captcha/',  
        )));
        $captcha->setAttrib('placeholder','Identity Code');                
        $captcha->removeDecorator('HtmlTag')->removeDecorator('Label');                               
            
        $sm=new Zend_Form_Element_Button('submit');
        $sm->setAttrib('type','submit');
        $sm->setLabel('Signup')
            ->removeDecorator('dtddwrapper');                                         
        
        $this->setDecorators(array(
                                   array('viewScript',
                                   array('viewScript'=>'/template/form_regis.phtml'),
                                )));                        
           
        $this->addElements(array($fullname,$email, $captcha, $pass,$sm));
        
                                          
    }
}